#ifndef CAPTURESIGNAL_H
#define CAPTURESIGNAL_H

#include <QObject>
#include <QSocketNotifier>
#include "client_manager.h"

class CaptureSignal: public QObject
{
    Q_OBJECT
public:
    CaptureSignal(QObject* parent = nullptr);
    void getObject(ClientManager* object);//获得主窗口对象

    static int setup_unix_signal_handlers();
    // Unix signal handlers
    static void intSignalHandler(int unused);
public slots:
    // Qt signal handlers.
    void handleSigInt();
private:
    static int sigintFd[2];

    ClientManager* obj;

    QSocketNotifier* snInt;
};

#endif // CAPTURESIGNAL_H
